package com.woniuxy.woniuticket.notification.controller;


import com.woniuxy.woniuticket.notification.handle.MyWebSocketHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.TextMessage;
//配置消费者的cortorller
@RestController
public class ClientController {
    @Autowired
    public MyWebSocketHandler handler;
    //监听队列
    @RabbitListener(queues = "queue")
    public void Recive(String msg) throws Exception{
        handler.sendMsgToJsp(new TextMessage(msg), "A");
    }
}
